package org.flyking;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.flyking.data.Requirement;
import org.flyking.tool.Read;
import org.flyking.common.Configure;
import org.flyking.tool.Write;

import java.util.List;


/**
 * Hello world!
 *
 */
public class App 
{
    private static final Logger logger = LogManager.getLogger(App.class);

    public static void main( String[] args )
    {
        Configure.Log4j2Config();
        //System.out.println(Read.getClsPath());
        logger.debug(Read.getCurDir() );
        List<Requirement> result=Read.readExcelData(".\\ExcelTask\\src\\test\\file\\a.xls", Requirement.class);

        Write.exportToWord(result,".\\ExcelTask\\src\\test\\file\\out.docx");

        // 示例：打印前5条
       // logger.debug("\n===== 前5条记录 =====");
        result.stream().limit(5).forEach(element ->
            {
                logger.info(element.getReqNo());
            });

        // 实际业务中可操作result列表
        //logger.info("处理完成，总计: " + result.size() + " 条需求");

    }
}
